package com.lashou.chunshen.lashoutuangou.activity;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;

import com.lashou.chunshen.lashoutuangou.R;
import com.lashou.chunshen.lashoutuangou.core.BaseActivity;
import com.lashou.chunshen.lashoutuangou.core.BaseFragment;
import com.lashou.chunshen.lashoutuangou.fragments.LoadingFragment;

import butterknife.InjectView;

/**
 * 启动页面
 * Created by momo on 2016/8/31.
 */
public class LoadingActivity extends BaseActivity{
    @InjectView(R.id.load_viewpage)
    ViewPager load_viewpage;

    public class ViewPagerAdapter extends FragmentPagerAdapter {
        public ViewPagerAdapter(FragmentManager fm) {
            super(fm);
        }

        @Override
        public Fragment getItem(int position) {
            return LoadingFragment.newInstance(position);
        }


        @Override
        public int getCount() {
            return 3;
        }
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_loading);
        initView();
    }
    private ViewPagerAdapter adapter;
    private void initView() {
        adapter = new ViewPagerAdapter(getSupportFragmentManager());
        load_viewpage.setAdapter(adapter);
        this.load_viewpage.setOffscreenPageLimit(0);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    @Override
    protected BaseFragment getFirstFragment() {
        return null;
    }

    @Override
    protected int getContentViewId() {
        return R.layout.activity_loading;
    }

    @Override
    protected int getFragmentContentId() {
        return 0;
    }

    @Override
    protected boolean isNeedTitleBar() {
        return false;
    }


}
